<?php
// @formatter:off
/**
 * @file usermenu.php
 * @author Alejandro Dario Simi
 * @date $Date: 2013-06-17 01:26:11 +0000 (Mon, 17 Jun 2013) $
 *
 * $Id: usermenu.php 74 2013-06-17 01:26:11Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0.0.2/themes/default/controlers/others/usermenu.php $
 */
// @formatter:on

global $wcThemeAssigns;

$wcThemeAssigns["UserMenuItems"] = array();

if(isset($wcThemeAssigns["ENABLE-GROUPSWITCH"])) {
	$aux = array(
		"name" => "Change Group",
		"title" => "Change Group",
		"icon" => "home-icon.png",
		"action" => "wcSimpleContainer.openUrl('simplecontainer.php?action=".WC_SACTION_GROUP_SWITCH."&group={$groupId}')"
	);
	$wcThemeAssigns["UserMenuItems"][] = $aux;
}

if(defined("__IS_MOBILE__")) {
	$status = defined("__MOBILE__");
	$aux = array(
		"name" => "Mobile Mode",
		"title" => "Switch mobile mode to ".($status ? "Off" : "On"),
		"icon" => "mobile-icon.png",
		"action" => "SetMobile('".WC_SERVICE_MOBILE."', ".($status ? "false" : "true").")"
	);
	$wcThemeAssigns["UserMenuItems"][] = $aux;
}

if($wcSession->isLogged()) {
	$aux = array(
		"name" => "Profile",
		"title" => "Edit my profile",
		"ficon" => $wcThemeAssigns["USER-AVATAR"],
		"url" => "?action=".WC_ACTION_USER_EDIT."&group={$groupId}&user={$wcUser->id()}",

		"zoomid" => 1000,
		"zoompath" => $wcThemeAssigns["USER-AVATAR"]
	);
	$wcThemeAssigns["UserMenuItems"][] = $aux;
	$aux = array(
		"name" => "Log Out",
		"title" => "Log Out",
		"icon" => "no-user-icon.png",
		"action" => "LogOut('".WC_SERVICE_LOG_OUT."', {$wcUser->id})"
	);
	$wcThemeAssigns["UserMenuItems"][] = $aux;
} else {
	$aux = array(
		"name" => "Log In",
		"title" => "Log In",
		"icon" => "user-icon.png",
		"action" => "wcSimpleContainer.openUrl('simplecontainer.php?action=".WC_SACTION_LOG_IN."')"
	);
	$wcThemeAssigns["UserMenuItems"][] = $aux;
	$aux = array(
		"name" => "Sign Up",
		"title" => "Register as user",
		"icon" => "user-icon.png",
		"url" => "?action=".WC_ACTION_USER_REGISTER."&group={$groupId}"
	);
	$wcThemeAssigns["UserMenuItems"][] = $aux;
}
?>